package cn.hsa.xxx.inStorage.controller;

import cn.hsa.hsaf.core.framework.web.WrapperResponse;
import cn.hsa.xxx.api.dto.BookInventoryDTO;
import cn.hsa.xxx.api.dto.InventoryBatchDTO;
import cn.hsa.xxx.inStorage.service.InStorageService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/web/inStorage/InStorage")
@RestController
@Slf4j
@Api(tags = "书籍入库")
public class InStorageController {

    @Autowired
    private InStorageService inStorageService;

    @PostMapping("/")
    public WrapperResponse<BookInventoryDTO> inStorage(@RequestBody InventoryBatchDTO inventoryBatchDTO) {
        BookInventoryDTO bookInventoryDTO = inStorageService.addStorage(inventoryBatchDTO);
        return WrapperResponse.success(bookInventoryDTO);
    }

}
